<table id ='ListOfComponents' "cellspacing="0" class="sf_admin_list">            
       <thead>
            <tr>
                  <th id="sf_admin_list_th_productcode" width="25%">Product Code
                          </th>
                  <th id="sf_admin_list_th_description" width="35%">Description
                          </th>
                  <th id="sf_admin_list_th_description" width="20%">Brand
                          </th>       
                  <th id="sf_admin_list_th_description" width="15%">Unit
                          </th>
                  <th id="sf_admin_list_th_description" width="5%">Add
                          </th>
            </tr>
       </thead>            

<?php 
    foreach($componentsList as $key=>$components) { 
    $component= ComponentPeer::retrieveByPK($components->getComponentId());
?>
    
    <tr class="sf_admin_row_<?php echo $key % 2; ?>">
        <td ><?php echo $component->getProductcode() ?></td>
        <td ><?php echo $component->getDescription() ?></td>
        <td ><?php echo $component->getBrand() ?></td>
        <td ><?php echo $component->getComponentunit()?></td>
        <td ><input type="checkbox" name = "components" id ="components" class ="ChkboxComponents" rowId="<? echo $component->getId() ?>"></td>
    </tr>
<?php } ?>
</table>
<?php 
foreach($componentsList as $key=>$components) { 
    $component= ComponentPeer::retrieveByPK($components->getComponentId());
    $c = new Criteria();
    $c->add(WarehousePeer::COMPONENT_ID , $component->getId());
    $warehouses = WarehousePeer::doSelect($c);
    $warehouse = $warehouses[0];
?>
    <?php 
        echo '<input type="hidden" name="productCode[' . $component->getId() . ']" id="productCode_' . $component->getId() . '"  value="'. $component->getProductcode() .'" />'; 
        echo '<input type="hidden" name="description[' . $component->getId() . ']" id="description_' . $component->getId() . '"  value="'. $component->getDescription() .'" />'; 
        echo '<input type="hidden" name="brand[' . $component->getId() . ']" id="brand_' . $component->getId() . '"  value="'. $component->getBrand() .'" />';
        echo '<input type="hidden" name="unit[' . $component->getId() . ']" id="unit_' . $component->getId() . '"  value="'. $component->getComponentunit() .'" />';
        echo '<input type="hidden" name="minStockQty[' . $component->getId() . ']" id="minStockQty_' . $component->getId() . '"  value="'. $component->getMinstockqty() .'" />';
        echo '<input type="hidden" name="stockQty[' . $component->getId() . ']" id="stockQty_' . $component->getId() . '"  value="'. $warehouse->getClosing() .'" />';
        echo '<input type="hidden" name="outstandingQty[' . $component->getId() . ']" id="outstandingQty_' . $component->getId() . '"  value="'. $components->getQty4() .'" />';
    ?>
<?php } ?>

